﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JtextEpicsInterface
{
    [Serializable]
    public class Record_prop
    {
        //this class holds the properties of the recode
        //mybe need to be serializebale
        //most of it is relevent to epics recode
        #region epicsSharp
        //this is the same to the epics sharp lib

        /// <summary>
        /// Gets or sets the describtion.
        /// </summary>
        /// <value>
        /// The DESC.
        /// </value>
        public string DESC { get; set; } //the description in XML
        /// <summary>
        /// Gets or sets the Engennering Units.in XML
        /// </summary>
        /// <value>
        /// The EGU.
        /// </value>
        public string EGU { get; set; }     //enginering unit in XML
        /// <summary>
        /// Gets or sets the HIGH limit.in XML
        /// </summary>
        /// <value>
        /// The HIGH.
        /// </value>
        public double HIGH { get; set; }    //in XML
        /// <summary>
        /// Gets or sets the HIHI limit.in XML
        /// </summary>
        /// <value>
        /// The HIHI.
        /// </value>
        public double HIHI { get; set; }     //
        /// <summary>
        /// Gets or sets the LOW limit. in xml
        /// </summary>
        /// <value>
        /// The LOW.
        /// </value>
        public double LOW { get; set; }  //in XML
        /// <summary>
        /// Gets or sets the LOLO limit.
        /// </summary>
        /// <value>
        /// The LOLO.
        /// </value>
        public double LOLO { get; set; }     //in XML
        /// <summary>
        /// Gets or sets the SCANINTERVAL.
        /// </summary>
        /// <value>
        /// The SCANINTERVAL.
        /// </value>
        public int SCANINTERVAL { get; set; }    //in XML
        /// <summary>
        /// Gets or sets the high display limit.in XML
        /// </summary>
        /// <value>
        /// The high display limit.
        /// </value>
        public double HighDisplayLimit { get; set; }    //
        /// <summary>
        /// Gets or sets the low display limit.in XML
        /// </summary>
        /// <value>
        /// The low display limit.
        /// </value>
        public double LowDisplayLimit { get; set; }    //

        /// <summary>
        /// Gets or sets the string of the severity.
        /// </summary>
        /// <value>
        /// The SEVR.
        /// </value>
        public string SEVR { get; set; }  //the string of the severity
        /// <summary>
        /// Gets or sets the connect STAT.
        /// </summary>
        /// <value>
        /// The STAT.
        /// </value>
        public string STAT { get; protected set; }

        public DateTime TIME { get; set; }
        public object val { set; get; } //not used

        #endregion

        #region driver&plugin

        /// <summary>
        /// the driver path not the Driver file path but the driver path for driver to get the value for this record, like channel ect;IN XML
        /// </summary>
        public string Drv_path; //in XML
        /// <summary>
        /// the driver name的
        /// </summary>
        public string Drv_name; //in XML
        /// <summary>
        /// the plugins the drivers is using
        /// </summary>
        public string[] PlugIns;//one record may fave muliple plugins in XML 

        #endregion



        #region additional

        public double pVal { get; set; } //the proccessed value not used 
        /// <summary>
        /// Gets or sets the name of the pv. in XML
        /// </summary>
        /// <value>
        /// The name of the pv.
        /// </value>
        public string pvName { get; set; }   //in XML
        /// <summary>
        /// is the record an input or output ,we called direction maybe   in XML
        /// </summary>
        public bool isInput;    // we called direction maybe   in XML
        /// <summary>
        ///some extra information that could be anything of be used by any one  in XML 
        /// </summary>
        public object eXtension;    //some extra information that could be anything of be used by any one  in XML
        /// <summary>
        /// 0,singal element,value;1,array data in XML
        /// </summary>
        public int DataClass;   //0,singal element,value;1,array data in XML


        /// <summary>
        /// indicate the datatype of the record, in XML
        /// <seealso cref="= CommonConst"/>
        /// </summary>
        public string DataType;
        /// <summary>
        /// if it's a array record ,this is it lenth in XML
        /// </summary>
        public int ArrayLen;    //if it's a array record ,this is it lenth in XML
        #endregion

        #region Device
        /// <summary>
        /// in which Device;in XML
        /// </summary>
        public string DeviceName;   //in which Device;in XML
        /// <summary>
        /// one device property is co-respond to a pvName in=="NULL" then this record is not a DeviceProperty in XML
        /// </summary>
        public string DeviceProperty;   //one device property is co-respond to a pvName in=="NULL" then this record is not a DeviceProperty in XML
        /// <summary>
        /// //the dataType of this  device Property ，//in this string ,we use a patern like: DataType;Direction.；in XML
        /// </summary>
        public string DeviceDtatType;   //the dataType of this  device Property ，//in this string ,we use a patern like: DataType;Direction.；in XML
            
        #endregion


        #region mathmetic

        /// <summary>
        /// when linar transform the multipliyer in XML
        /// </summary>
        public double multilple;     //when linar transform the multipliyer in XML
        /// <summary>
        /// when linar tranfor the offset in XML
        /// </summary>
        public double offset;        //when linar tranfor the offset in XML

        #endregion

    }

}
